<?php

namespace Kunfeng\Dify\Model\File;

/**
 * 文件上传响应模型
 */
class FileUploadResponse
{
    private $id;
    private $name;
    private $size;
    private $type;
    private $url;

    public function __construct(array $data)
    {
        $this->id = $data['id'] ?? '';
        $this->name = $data['name'] ?? '';
        $this->size = $data['size'] ?? 0;
        $this->type = $data['type'] ?? '';
        $this->url = $data['url'] ?? '';
    }

    /**
     * 从数组创建
     */
    public static function fromArray(array $data): self
    {
        return new self($data);
    }

    // Getters
    public function getId(): string
    {
        return $this->id;
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function getSize(): int
    {
        return $this->size;
    }

    public function getType(): string
    {
        return $this->type;
    }

    public function getUrl(): string
    {
        return $this->url;
    }
}
